Skip to content

Deprecation note for UIButton.setInsets(forContentPadding:imageTitlePadding:)#911

Open
rmnli wants to merge 1 commit intomastodon:developfrom
rmnli:button_set_insets_deprecation
Open

Deprecation note for UIButton.setInsets(forContentPadding:imageTitlePadding:)#911
rmnli wants to merge 1 commit intomastodon:developfrom
rmnli:button_set_insets_deprecation

Conversation

@rmnli
Copy link
Copy Markdown
Contributor

@rmnli rmnli commented Jan 24, 2023

Problem

UIButton.setInsets(forContentPadding:imageTitlePadding:) hides the warnings about UIButton.contentEdgeInsets and UIButton.titleEdgeInsets.

Impact of the change

All uses of the function will be highlighted by Xcode. The developer will be informed that the function includes the deprecated API.

@j-f1
Copy link
Copy Markdown
Contributor

j-f1 commented Jan 25, 2023

Per #783 (comment), these warnings are probably safe to ignore since none of the code is using the UIButton.Configuration API.

@rmnli
Copy link
Copy Markdown
Contributor Author

rmnli commented Jan 25, 2023

@j-f1 thanks for clarification.
But I noticed that the new api is already in use (see Scene/Onboarding/ConfirmEmail/MastodonConfirmEmailViewController.swift).
And I agree that this is safe, but it will be harder to migrate in the future if UIButton.setInsets is used frequently in the project.

@j-f1
Copy link
Copy Markdown
Contributor

j-f1 commented Jan 25, 2023

Good point, I guess it makes sense to leave the warnings in then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants